#include<iostream>
using namespace std;
struct TreeNode {
      int val;
      TreeNode *left;
      TreeNode *right;
 };
 class Solution {
public:
    TreeNode* mirrorTree(TreeNode* root) {
        if(root==NULL)return NULL;
        TreeNode* left=mirrorTree(root->left);
        TreeNode* right=mirrorTree(root->right);
        root->left=right;
        root->right=left;
        return root;
    }
};